package com.evil.application.api;


import com.evil.application.config.FeignErrorDecoder;
import com.evil.application.pojo.dto.template.*;
import com.evil.application.pojo.dto.template.print.*;
import com.evil.common.core.constant.ServiceNameConstant;
import com.evil.common.file.dto.FileRespDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 应用打印模板接口
 */
@FeignClient(name = ServiceNameConstant.APPLICATION_SERVICE, configuration = {FeignErrorDecoder.class})
public interface RemoteApplicationPrintTemplateService {

    /**
     * 获取打印模板列表
     *
     * @param printTemplateListReqDTO templateListReqDTO
     * @return List
     */
    @PostMapping("/remote/application/print-template/list")
    List<PrintTemplateRespDTO> list(@Validated @RequestBody PrintTemplateListReqDTO printTemplateListReqDTO);

    /**
     * 保存打印模板
     *
     * @param savePrintTemplateReqDTO addUploadTemplateReqDTO
     */
    @PostMapping("/remote/application/print-template/save")
    void save(@Validated @RequestBody SavePrintTemplateReqDTO savePrintTemplateReqDTO);

    /**
     * 重命名打印模板
     *
     * @param renamePrintTemplateReqDTO templateRenameReqDTO
     */
    @PostMapping("/remote/application/print-template/rename")
    void rename(@Validated @RequestBody RenamePrintTemplateReqDTO renamePrintTemplateReqDTO);

    /**
     * 删除打印模板
     *
     * @param deletePrintTemplateReqDTO deleteTemplateReqDTO
     */
    @PostMapping("/remote/application/print-template/delete")
    void delete(@Validated @RequestBody DeletePrintTemplateReqDTO deletePrintTemplateReqDTO);

    /**
     * 打印模板详情
     *
     * @param printTemplateDetailReqDTO templateDetailReqDTO
     * @return TemplateRespDTO
     */
    @PostMapping("/remote/application/print-template/detail")
    PrintTemplateRespDTO detail(@Validated @RequestBody PrintTemplateDetailReqDTO printTemplateDetailReqDTO);

    /**
     * 上传打印模板
     *
     * @param uploadTemplateReqDTO uploadTemplateReqDTO
     */
    @PostMapping(value = "/remote/application/print-template/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    FileRespDTO upload(@Validated UploadTemplateReqDTO uploadTemplateReqDTO);

    /**
     * 下载打印模板
     *
     * @param downloadPrintTemplateReqDTO downloadTemplateReqDTO
     * @return FileRespDTO
     */
    @PostMapping("/remote/application/print-template/download")
    FileRespDTO download(@Validated @RequestBody DownloadPrintTemplateReqDTO downloadPrintTemplateReqDTO);

    /**
     * 打印模板数据
     *
     * @param printTemplateReqDTO printTemplateReqDTO
     */
    @PostMapping("/remote/application/print-template/print")
    FileRespDTO printTemplate(@Validated @RequestBody PrintTemplateReqDTO printTemplateReqDTO);
}
